﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Carto;


namespace ODM_AddIn
{
    public class dbgAnalysisOutlineButton : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        public dbgAnalysisOutlineButton()
        {
        }

        protected override void OnClick()
        {
            IMap map = ArcMap.Document.FocusMap;
            string dllPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string hollowPath = dllPath + "\\res\\AnalysisAreasHollow.lpk";

            ILayerFile lFile = new LayerFileClass();
            lFile.Open(hollowPath);
            ILayer layer = lFile.Layer;

            ILegendInfo lInfo = (ILegendInfo)layer;
            lInfo.get_LegendGroup(0).Visible = false;

            if (layer != null)
            {
                map.AddLayer(layer);
            }
        }

        protected override void OnUpdate()
        {
        }
    }
}
